<include file="public@header" />
<link rel="stylesheet" type="text/css" href="__STATIC__/layui/css/layui.css">
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:url('order/index')}">订单列表</a></li>
			<li class="active"><a href="{:url('order/add')}">添加订单</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form margin-top-20 layui-form" action="{:url('order/add')}">
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span class="form-required">*</span>产品信息
				</label>
				<div class="col-md-3 col-sm-6">
					<input type="text" class="form-control" name="title">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span class="form-required">*</span>注意事项
				</label>
				<div class="col-md-6 col-sm-10">
					<script type="text/plain" id="content" name="post[post_content]"></script>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span class="form-required"></span>相关项目
				</label>
				<div class="col-md-3 col-sm-6">
					<select class="form-control" name="project_id" lay-search="">
			          	<option value="">请选择项目</option>
			          	<foreach name="project_list" item="vo">
			          		<option value="{$vo.id}">{$vo.title}|{$vo.project_no}</option>
			          	</foreach>
			        </select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span class="form-required"></span>厂家
				</label>
				<div class="col-md-3 col-sm-6">
					<select class="form-control" name="manufacturer_id" lay-search="">
			          	<option value="">请选择厂家</option>
			          	<foreach name="manufacturer_list" item="vo">
			          		<option value="{$vo.id}">{$vo.name}</option>
			          	</foreach>
			        </select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span class="form-required">*</span>收货人
				</label>
				<div class="col-md-3 col-sm-6">
					<input type="text" class="form-control" name="contact_name">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span class="form-required">*</span>联系电话
				</label>
				<div class="col-md-3 col-sm-6">
					<input type="text" class="form-control" name="contact_number">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span class="form-required">*</span>收货地址
				</label>
				<div class="col-md-3 col-sm-6">
					<input type="text" class="form-control" name="address">
					<a onclick="doSelectLocation(this)">选择地址</a>
					<input type="hidden" name="lat">
					<input type="hidden" name="lng">
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
				</div>
			</div>
		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script src="__STATIC__/layui/layui.js"></script>
<script type="text/javascript">
	layui.use(['form'], function(){
		var form = layui.form;
	});
    $(function () {

        editorcontent = new baidu.editor.ui.Editor();
        editorcontent.render('content');
        try {
            editorcontent.sync();
        } catch (err) {
        }

    });

	function doSelectLocation(obj) {
        var $obj       = $(obj);
        var title      = $obj.data('title');
        var $realInput = $obj;
        var location   = $realInput.val();

        openIframeLayer(
            "{:url('index/map')}?location=" + location,
            '选择定位',
            {
                area: ['700px', '90%'],
            }
        );
    }
</script>
</body>
</html>